package pub.model;

import javax.persistence.Column;
import javax.persistence.Embeddable;

/**
 * RolefunctionId entity. @author MyEclipse Persistence Tools
 */
@Embeddable
public class RolefunctionId implements java.io.Serializable {

	// Fields

	private Integer roleId;
	private Integer functionId;

	// Constructors

	/** default constructor */
	public RolefunctionId() {
	}

	/** full constructor */
	public RolefunctionId(Integer roleId, Integer functionId) {
		this.roleId = roleId;
		this.functionId = functionId;
	}

	// Property accessors

	@Column(name = "roleId", nullable = false)
	public Integer getRoleId() {
		return this.roleId;
	}

	public void setRoleId(Integer roleId) {
		this.roleId = roleId;
	}

	@Column(name = "functionId", nullable = false)
	public Integer getFunctionId() {
		return this.functionId;
	}

	public void setFunctionId(Integer functionId) {
		this.functionId = functionId;
	}

	public boolean equals(Object other) {
		if ((this == other))
			return true;
		if ((other == null))
			return false;
		if (!(other instanceof RolefunctionId))
			return false;
		RolefunctionId castOther = (RolefunctionId) other;

		return ((this.getRoleId() == castOther.getRoleId()) || (this.getRoleId() != null && castOther.getRoleId() != null && this
				.getRoleId().equals(castOther.getRoleId())))
				&& ((this.getFunctionId() == castOther.getFunctionId()) || (this.getFunctionId() != null
						&& castOther.getFunctionId() != null && this.getFunctionId().equals(castOther.getFunctionId())));
	}

	public int hashCode() {
		int result = 17;

		result = 37 * result + (getRoleId() == null ? 0 : this.getRoleId().hashCode());
		result = 37 * result + (getFunctionId() == null ? 0 : this.getFunctionId().hashCode());
		return result;
	}

}